<HTML><HEAD><TITLE>max(+ExprList, -Result)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>max(+ExprList, -Result)</H1>
Evaluates the the arithmetic expressions in ExprList and unifies their maximum
with Result.


<DL>
<DT><EM>ExprList</EM></DT>
<DD>A list of arithmetic expressions.
</DD>
<DT><EM>Result</EM></DT>
<DD>A variable or number.
</DD>
</DL>
<H2>Description</H2>
   This predicate is used by the ECLiPSe compiler to expand evaluable
    arithmetic expressions.  So the call to max(ExprList, Result) is
    equivalent to
<PRE>
    Result is max(ExprList)
</PRE>
    which should be preferred.
<P>
   In coroutining mode, if the list is only partly instantiated, the
   predicate delays until the list is complete.

<H3>Modes and Determinism</H3><UL>
<LI>max(+, -) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>ExprList is a partial list (non-coroutining mode only).
<DT><EM>(5) type error </EM>
<DD>ExprList is not a proper list.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      X is max([1,2,3]).    % gives X = 3
      X is max([1,2.0,3]).  % gives X = 3.0
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/arithmetic/is-2.html">is / 2</A>, <A HREF="../../kernel/arithmetic/max-3.html">max / 3</A>, <A HREF="../../kernel/arithmetic/min-2.html">min / 2</A>
</BODY></HTML>
